package com.atguigu.gmall2023sugar.mapper;

import com.atguigu.gmall2023sugar.bean.Traffic;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

/**
 * @Author lzc
 * @Date 2023/7/18 14:28
 */
public interface  TrafficMapper {
    @Select("select " +
        "hour(stt) hr, " +
        "sum(pv_ct) pv, " +
        "sum(uv_ct) uv, " +
        "sum(sv_ct) sv " +
        "from dws_traffic_vc_ch_ar_is_new_page_view_window partition(par${date}) " +
        "group by hr")
    List<Traffic> traffic (String date);
    
    @Select("select " +
        "   keyword, " +
        "   sum(keyword_count) keyword_count " +
        "from dws_traffic_source_keyword_page_view_window partition(par${date}) " +
        "group by keyword")
    List<Map<String, Object>> kw(String date);
    
    
}
